﻿using System;
using System.Data.Linq;
using System.Data.Linq.Mapping;

namespace DataEntities
{
    [Table(Name = "dbo.KeHuInfo")]
    public partial class KeHuInfo : Entity
    {
        private int _iKeHuId;

        private string _sName;

        private bool _bSex;

        private string _sIdCard;

        private string _sDriveId;

        private bool _bBlackList;

        private Binary _mPhoto;

        private DateTime _tRegiDate;

        private bool _bLogout;

        private DateTime _tLogoutDate;

        private EntitySet<YuZuInfo> _YuZuInfo;

        private EntitySet<ChuZuInfo> _ChuZuInfo;

        private EntitySet<TuiHuanInfo> _TuiHuanInfo;

        private EntitySet<WeiZhangInfo> _WeiZhangInfo;

        public KeHuInfo()
        {
            this._YuZuInfo = new EntitySet<YuZuInfo>(new Action<YuZuInfo>(this.attach_YuZuInfo), new Action<YuZuInfo>(this.detach_YuZuInfo));
            this._ChuZuInfo = new EntitySet<ChuZuInfo>(new Action<ChuZuInfo>(this.attach_ChuZuInfo), new Action<ChuZuInfo>(this.detach_ChuZuInfo));
            this._TuiHuanInfo = new EntitySet<TuiHuanInfo>(new Action<TuiHuanInfo>(this.attach_TuiHuanInfo), new Action<TuiHuanInfo>(this.detach_TuiHuanInfo));
            this._WeiZhangInfo = new EntitySet<WeiZhangInfo>(new Action<WeiZhangInfo>(this.attach_WeiZhangInfo), new Action<WeiZhangInfo>(this.detach_WeiZhangInfo));
        }

        [Column(Storage = "_iKeHuId", AutoSync = AutoSync.OnInsert, DbType = "Int NOT NULL IDENTITY", IsPrimaryKey = true, IsDbGenerated = true)]
        public int iKeHuId
        {
            get
            {
                return this._iKeHuId;
            }
            set
            {
                if ((this._iKeHuId != value))
                {
                    this.SendPropertyChanging("iKeHuId");
                    this._iKeHuId = value;
                    this.SendPropertyChanged("iKeHuId",value);
                }
            }
        }

        [Column(Storage = "_sName", DbType = "VarChar(16)")]
        public string sName
        {
            get
            {
                return this._sName;
            }
            set
            {
                if ((this._sName != value))
                {
                    this.SendPropertyChanging("sName");
                    this._sName = value;
                    this.SendPropertyChanged("sName",value);
                }
            }
        }

        [Column(Storage = "_bSex", DbType = "Bit")]
        public bool bSex
        {
            get
            {
                return this._bSex;
            }
            set
            {
                if ((this._bSex != value))
                {
                    this.SendPropertyChanging("bSex");
                    this._bSex = value;
                    this.SendPropertyChanged("bSex",value);
                }
            }
        }

        [Column(Storage = "_sIdCard", DbType = "VarChar(18)")]
        public string sIdCard
        {
            get
            {
                return this._sIdCard;
            }
            set
            {
                if ((this._sIdCard != value))
                {
                    this.SendPropertyChanging("sIdCard");
                    this._sIdCard = value;
                    this.SendPropertyChanged("sIdCard",value);
                }
            }
        }

        [Column(Storage = "_sDriveId", DbType = "VarChar(18)")]
        public string sDriveId
        {
            get
            {
                return this._sDriveId;
            }
            set
            {
                if ((this._sDriveId != value))
                {
                    this.SendPropertyChanging("sDriveId");
                    this._sDriveId = value;
                    this.SendPropertyChanged("sDriveId",value);
                }
            }
        }

        [Column(Storage = "_bBlackList", DbType = "Bit")]
        public bool bBlackList
        {
            get
            {
                return this._bBlackList;
            }
            set
            {
                if ((this._bBlackList != value))
                {
                    this.SendPropertyChanging("bBlackList");
                    this._bBlackList = value;
                    this.SendPropertyChanged("bBlackList",value);
                }
            }
        }

        [Column(Storage = "_mPhoto", DbType = "Image", CanBeNull = true, UpdateCheck = UpdateCheck.Never)]
        public System.Data.Linq.Binary mPhoto
        {
            get
            {
                return this._mPhoto;
            }
            set
            {
                if ((this._mPhoto != value))
                {
                    this.SendPropertyChanging("mPhoto");
                    this._mPhoto = value;
                    this.SendPropertyChanged("mPhoto",value);
                }
            }
        }

        [Column(Storage = "_tRegiDate", DbType = "DateTime")]
        public DateTime tRegiDate
        {
            get
            {
                return this._tRegiDate;
            }
            set
            {
                if ((this._tRegiDate != value))
                {
                    this.SendPropertyChanging("tRegiDate");
                    this._tRegiDate = value;
                    this.SendPropertyChanged("tRegiDate",value);
                }
            }
        }

        [Column(Storage = "_bLogout", DbType = "Bit")]
        public bool bLogout
        {
            get
            {
                return this._bLogout;
            }
            set
            {
                if ((this._bLogout != value))
                {
                    this.SendPropertyChanging("bLogout");
                    this._bLogout = value;
                    this.SendPropertyChanged("bLogout",value);
                }
            }
        }

        [Column(Storage = "_tLogoutDate", DbType = "DateTime")]
        public DateTime tLogoutDate
        {
            get
            {
                return this._tLogoutDate;
            }
            set
            {
                if ((this._tLogoutDate != value))
                {
                    this.SendPropertyChanging("tLogoutDate");
                    this._tLogoutDate = value;
                    this.SendPropertyChanged("tLogoutDate",value);
                }
            }
        }

        [Association(Name = "KeHuInfo_YuZuInfo", Storage = "_YuZuInfo", ThisKey = "iKeHuId", OtherKey = "iKeHuId")]
        public EntitySet<YuZuInfo> YuZuInfo
        {
            get
            {
                return this._YuZuInfo;
            }
            set
            {
                this._YuZuInfo.Assign(value);
            }
        }

        [Association(Name = "KeHuInfo_ChuZuInfo", Storage = "_ChuZuInfo", ThisKey = "iKeHuId", OtherKey = "iKeHuId")]
        public EntitySet<ChuZuInfo> ChuZuInfo
        {
            get
            {
                return this._ChuZuInfo;
            }
            set
            {
                this._ChuZuInfo.Assign(value);
            }
        }

        [Association(Name = "KeHuInfo_TuiHuanInfo", Storage = "_TuiHuanInfo", ThisKey = "iKeHuId", OtherKey = "iKeHuId")]
        public EntitySet<TuiHuanInfo> TuiHuanInfo
        {
            get
            {
                return this._TuiHuanInfo;
            }
            set
            {
                this._TuiHuanInfo.Assign(value);
            }
        }

        [Association(Name = "KeHuInfo_WeiZhangInfo", Storage = "_WeiZhangInfo", ThisKey = "iKeHuId", OtherKey = "iKeHuId")]
        public EntitySet<WeiZhangInfo> WeiZhangInfo
        {
            get
            {
                return this._WeiZhangInfo;
            }
            set
            {
                this._WeiZhangInfo.Assign(value);
            }
        }

        private void attach_YuZuInfo(YuZuInfo entity)
        {
            entity.KeHuInfo = this;
        }

        private void detach_YuZuInfo(YuZuInfo entity)
        {
            entity.KeHuInfo = null;
        }

        private void attach_ChuZuInfo(ChuZuInfo entity)
        {
            entity.KeHuInfo = this;
        }

        private void detach_ChuZuInfo(ChuZuInfo entity)
        {
            entity.KeHuInfo = null;
        }

        private void attach_TuiHuanInfo(TuiHuanInfo entity)
        {
            entity.KeHuInfo = this;
        }

        private void detach_TuiHuanInfo(TuiHuanInfo entity)
        {
            entity.KeHuInfo = null;
        }

        private void attach_WeiZhangInfo(WeiZhangInfo entity)
        {
            entity.KeHuInfo = this;
        }

        private void detach_WeiZhangInfo(WeiZhangInfo entity)
        {
            entity.KeHuInfo = null;
        }
    }
}
